/*******************************************************************
 *          File Name : regahb_agent.sv
 *             File description :
 *          Author : tanxiao
 *          Date : 2013.6.26
 *          History : 2013.6.26        import             tanxiao
 *******************************************************************
*/

class regAHB_agent extends uvm_agent ;

   //driver 
   ahb_master_driver              hacc_reg_drv    ;

   //sequencer 
   regAHB_sequencer               hacc_reg_sqr    ;


   `uvm_component_utils(regAHB_agent)


   //Constructor
   function new(string name, uvm_component parent);
       super.new(name, parent);
   endfunction : new 


   //build phase
   function void build_phase(uvm_phase phase);
      super.build_phase(phase) ;

      if(get_is_active == UVM_ACTIVE) begin
          hacc_reg_drv = ahb_master_driver::type_id::create("hacc_reg_drv", this);
          hacc_reg_sqr = regAHB_sequencer::type_id::create("hacc_reg_sqr", this);
      end
   endfunction : build_phase



   function void connect_phase(uvm_phase phase);
      if(get_is_active == UVM_ACTIVE) begin
          hacc_reg_drv.seq_item_port.connect(hacc_reg_sqr.seq_item_export);
      end
   endfunction : connect_phase

endclass : regAHB_agent
